package com.dz.exception;

import com.dz.enumeration.AppHttpCodeEnum;

/**
 * @author 鄧浩奇
 * @classname SystemException
 * @description 统一异常处理
 * @since 2023/6/19 9:45
 **/

public class SystemException extends RuntimeException {

    private int code;

    private String msg;

    public void setCode(int code) {
        this.code = code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public SystemException(AppHttpCodeEnum httpCodeEnum) {
        this.code = httpCodeEnum.getCode();
        this.msg = httpCodeEnum.getMsg();
    }
}
